-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vim snippet to the README.rst #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, looks good. left a few comments/questions.
that said, as an avid emacs user, i can only say that vim script looks, eh, special. 🙃
vim_snippet.vim
Outdated
function! s:RunBlackMacchiato(visual) range | ||
let cmd = "black-macchiato" | ||
if !executable(cmd) | ||
echo "black-macchiato not found!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, vim does not have an error reporting function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I will use a different approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
vim_snippet.vim
Outdated
@@ -0,0 +1,25 @@ | |||
function! s:RunBlackMacchiato(visual) range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this also be run from the :
command prompt?
if so, maybe BlackMacchiato
is a more discoverable name?
if not, a :BlackMacchiato
command (it has tab completion i hope) that behaves the same as this function would be useful, and simpler to use in case users don't want to make a dedicated key binding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the function cannot be called as a command. For this to also work as a command, I will need to rewrite the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to learn how to do it 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
thanks, merged! 🚀 |
This PR adds a vimscript snippet to the README file.
This snippet works on the current line in the "normal" mode, and on the selected lines in the "visual" mode.